//
//  NSDictionary+json.m
//  HGMM
//
//  Created by huan liu on 2019/1/23.
//  Copyright © 2019年 xwx. All rights reserved.
//

#import "NSDictionary+json.h"

@implementation NSDictionary (json)

- (NSString *)toReadableJSONString {
    NSData *data = [NSJSONSerialization dataWithJSONObject:self
                                                   options:NSJSONWritingPrettyPrinted
                                                     error:nil];
    
    if (data == nil) {
        return nil;
    }
    
    NSString *string = [[NSString alloc] initWithData:data
                                             encoding:NSUTF8StringEncoding];
    return string;
}

@end
